<template>
  <el-card class="box-card">
    <div class="search-bar">
<!--        <span>首页>>>设备信息</span>
        <el-row>
            <el-col :span="12">
                <el-select>
                    <el-option value="1" label="请选择工作台"></el-option>
                    <el-option value="2" label="工作台1"></el-option>
                    <el-option value="3" label="工作台2"></el-option>
                    <el-option value="4" label="工作台...."></el-option>
                    <el-option value="5" label="工作台14"></el-option>
                </el-select>
            </el-col>
        </el-row>-->
      <el-form :inline='true' label-width="100px" >
          <el-row>
                <el-col :span="6"><div class="fontColor">123</div></el-col>
                
                <el-col :span="6">
                    <el-form-item label="操作员">
                        <el-input v-model="operator" placeholder="操作员" disabled></el-input>
                    </el-form-item>
                </el-col>
                <el-col :span="6">
                    <el-form-item label="设备名称">
                        <el-input v-model="fac_name" placeholder="设备名称" disabled></el-input>
                    </el-form-item>
                </el-col>
                <el-col :span="6"><div class="fontColor">123</div></el-col>
          </el-row>
          <el-row>
                <el-col :span="6"><div class="fontColor">123</div></el-col>
                <el-col :span="6">
                    <el-form-item label="工位名称">
                        <el-input v-model="workstationName" placeholder="工位名称" disabled></el-input>
                    </el-form-item>
                </el-col>
                <el-col :span="6">
                    <el-form-item label="设备编号">
                        <el-input v-model="timer_id" placeholder="设备编号" disabled></el-input>
                    </el-form-item>
                </el-col>
                <el-col :span="6"><div class="fontColor">123</div></el-col>
          </el-row>
          <el-row>
                <el-col :span="6"><div class="fontColor">123</div></el-col>
                <el-col :span="6">
                    <el-form-item label="监控值">
                        <el-input v-model="fac_name" placeholder="监控值" disabled></el-input>
                    </el-form-item>
                </el-col>
                <el-col :span="6">
                    <el-form-item label="故障">
                        <el-input v-model="alarm" placeholder="故障" disabled></el-input>
                    </el-form-item>
                </el-col>
                <el-col :span="6"><div class="fontColor">123</div></el-col>
          </el-row>
          <el-row>
                <el-col :span="6"><div class="fontColor">1</div></el-col>
<!--                <div><img src="../../assets/img/器具图标-焊机(3).png" alt=""></div>-->
                <el-col :span="6">
                    <el-form-item label="焊枪号">
                        <el-input v-model="group_num" placeholder="焊枪号" disabled></el-input>
                    </el-form-item>
                </el-col>
                
                <el-col :span="6">
                    <el-form-item label="焊接周期">
                        <el-input v-model="weld_cycle" placeholder="焊接周期" disabled></el-input>
                    </el-form-item>
                </el-col>
                <el-col :span="6"><div class="fontColor">123</div></el-col>
          </el-row>
          <el-row>
                <el-col :span="6"><div class="fontColor">123</div></el-col>
                <el-col :span="6">
                    <el-form-item label="一次焊接电流">
                        <el-input v-model="heat_1" placeholder="一次焊接电流" disabled></el-input>
                    </el-form-item>
                </el-col>
                <el-col :span="6">
                    <el-form-item label="二次焊接电流">
                        <el-input v-model="heat_2" placeholder="二次焊接电流" disabled></el-input>
                    </el-form-item>
                </el-col>
                <el-col :span="6"><div ></div></el-col>
          </el-row>
       <el-row :span="12">
           <el-col :span="4"><div class="fontColor">123</div></el-col>
           <el-col :span="4"><div class="fontColor">123</div></el-col>
           <el-col :span="4"><div class="fontColor">123</div></el-col>
           <el-col :span="4"><div class="fontColor">123</div></el-col>
           <el-col :span="4"><div class="fontColor">123</div></el-col>
           <el-col :span="4">
                <el-button type="primary" icon="el-icon-arrow-left" @click="RturnPage">返回</el-button> 
           </el-col>
           
          
      </el-row>
      </el-form>
      <div class="fl">
        <!-- <el-button type="text" @click="handleReset">重置</el-button>-->
      </div>
      
    </div>

  </el-card>
</template>
<script>
export default {
  data () {
    return {
      operator:'',
      workstationName: '',
      fac_name:'',
      weld_cycle:'',
      group_num:'',
      timer_id:'',
      alarm:'',
      heat_1:'',
      heat_2:'',
      fac_id:'',
    }
  },
  created () {
    this.getFacId()
    this.api.sysCurrent.getDeviceInfo({ id: this.fac_id}).then((res) => {
      if(res.data.length > 0){
          this.weld_cycle = res.data[0].Weld_Cycle
          this.group_num = res.data[0].Group_Num
          this.timer_id = res.data[0].Timer_Id
          this.alarm = res.data[0].Alarm
          this.heat_1 = res.data[0].Heat_1
          this.heat_2 = res.data[0].Heat_2
      }
    })
  },
  methods: {
      RturnPage:function(){
          this.$router.replace('/dashboard');
      },
      getFacId:function(){
          this.fac_id = this.getQueryVariable('facid');
          this.operator = sessionStorage.getItem("operator")
          this.workstationName = sessionStorage.getItem("workstationName")
      },
      getQueryVariable(variable) {
        let url = window.location.hash.split('?')[1].split("&");
        for (let i = 0; i < url.length; i++) {
          let pair = url[i].split('=');
          if (pair[0] == variable) {
            return pair[1]
          }
        }
        return false
      }
  }
}
</script>
<style lang="less">
.fontColor{
    color:white;
}
.fr {
  float: right;
}
.fl {
  float: left;
}
.search-bar {
  margin-top: 40px;
  overflow: hidden;
}
</style>

<style>
.tools-bar {
  margin-bottom: 20px;
}
</style>
